import React from "react";
export function GroupTapHoc(WrappedComponent) {
    // 泛型限定
    class GroupTap extends WrappedComponent {
        componentDidMount() {
            const { group } = this.props;
            if (group) {
                this.getGridInstance().columnOption(group, {
                    groupIndex: 0,
                });
                this.currentIsGroup = true;
                this.currentGroupField = group;
            }
        }
        parent = super.render();
        componentWillUnmount() {
            this.dataSource.dispose();
        }
        render() {
            const p_props = this.props ? this.props : this.parent.props;
            const props = {
                ...p_props,
            };
            return React.cloneElement(this.parent, { ...props });
        }
    }
    return GroupTap;
}
